<!-- BlogArticle.vue -->
<template>
  <div class="article">
    <div class="art-top">
      <span class="art-type">{{ blogType }}</span>
      <h3 class="title">{{ title }}</h3>
      <span class="pub-time">2023年 5月 12日</span>

      <p class="summary">
        前两天，服务器经历了一次崩溃重装。服务器的崩溃导致了博客无法访问、数据丢失、escook 小程序停服，同时很多线上 API 接口服务被迫终止。 经过两天的重装处理之后，博客和 escook
        小程序已基本恢复正常。此次事件…
      </p>

      <button class="btn-more">阅读更多</button>
    </div>

    <div class="art-bottom">
      <span class="author">作者：周星驰</span>
      <div class="art-bottom__right">
        <span class="cmt">{{ cmtCount }} 评论</span>
        <span class="favor" v-if="favor">★取消收藏</span>
        <span class="favor" v-else>☆收藏</span>
      </div>
    </div>
  </div>
</template>

<script setup>
const props = defineProps(['title', 'blogType', 'cmtCount', 'favor'])
console.log(props)
</script>

<style scoped>
.article {
  padding: 15px;
  box-sizing: border-box;
  border-bottom: 1px solid #efefef;
}

.art-top {
  display: flex;
  flex-direction: column;
  align-items: center;

  .art-type {
    font-size: 12px;
    font-weight: bold;
    color: #ca9b52;
  }

  .title {
    font-size: 30px;
    font-weight: normal;
    margin: 5px;
  }

  .pub-time {
    font-size: 13px;
    font-style: italic;
    color: #a1a1a1;
  }

  .summary {
    font-size: 13px;
    line-height: 2em;
    color: #464646;
    margin: 20px 0;
    text-align: justify;
  }

  .btn-more {
    color: #ca9b52;
    background-color: #fff;
    border: 1px solid #ca9b52;
    font-weight: bold;
    font-size: 11px;
    padding: 10px 25px;
    cursor: pointer;
    &:hover {
      opacity: 0.8;
    }
  }
}
.art-bottom {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-style: italic;
  margin-top: 20px;

  .author {
    color: #464646;
  }

  .cmt {
    color: #a1a1a1;
  }

  .favor {
    color: #464646;
    margin-left: 15px;
  }
}
</style>
